<?php

namespace app\platform\controller\admin;

use app\BaseController;

use app\beautiful\model\member\MemberModel;
use app\common\model\AllianceConf;

use app\common\model\ShopAllianceConfModel;
use app\common\model\ShopAllianceModel;
use app\common\model\ShopModel;


class Member extends BaseController{

    public function list(){
        $limit=$this->request->limit;
        $page=$this->request->page;
        $member_num = $this->request->param('member_num');
        $nick_name = $this->request->param('nick_name');
        $mobile = $this->request->param('mobile');
        $platform_money_type = $this->request->param('platform_money_type/d',0);//钱包余额（1有数据、2无数据)
        $lock_type = $this->request->param('lock_type/d',0);//锁客（1已锁定、2未锁定）
        $where=[];
        $order['a.member_id']='desc';
        $where['shop_id']=0;
        if(!empty($member_num)){
            $where['member_num']=$member_num;
        }
        if(!empty($nick_name)){
            $where['nick_name']=$nick_name;
        }
        if(!empty($mobile)){
            $where['mobile']=$mobile;
        }
        $where['platform_money_type']=$platform_money_type;
        $where['lock_type']=$lock_type;
        $res_data=MemberModel::list($where,$order,$page,$limit);
        return $this->success($res_data);
    }
    public function info(){
        $id = $this->request->param('member_id');
        $member_num = $this->request->param('member_num');
        $where=[];
        if(!empty($id)){
            $where['member_id']=$id;
        }
        if(!empty($member_num)){
            $where['member_num']=$member_num;
        }
        if(empty($where)){
            $this->error('参数错误');
        }
        $info=MemberModel::where($where)->find();
        return $this->success($info);
    }
}

